//
//  WebViewController.m
//  Root
//
//  Created by conkey on 2019/1/12.
//  Copyright © 2019 Root. All rights reserved.
//

#import "WebViewController.h"

@interface WebViewController ()

@property (strong, nonatomic) IBOutlet NSLayoutConstraint *webBottom;

@end

@implementation WebViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
    CGFloat height = 40.0f;
    CGFloat bottom = 0;
    
    CGFloat screenHeight = [UIScreen mainScreen].bounds.size.height;
    if (screenHeight == 896 || screenHeight == 812) {
        height = 75.0f;
        bottom = 35.0f;
    }
    
    [self adjustWebViewWithTop:[UIApplication sharedApplication].statusBarFrame.size.height bottom:height];
    self.webBottom.constant = bottom;
}

- (IBAction)handleLeftTap:(id)sender {
    if ([self.webView canGoBack]) {
        [self.webView goBack];
    }
}

- (IBAction)handleRightTap:(id)sender {
    if ([self.webView canGoForward]) {
        [self.webView goForward];
    }
}

- (IBAction)handleRefreshTap:(id)sender {
    [self.webView reload];
}

- (IBAction)handleHomeTap:(id)sender {
    [self startLoadRequest];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
